package com.dicti.domain;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import exam.domian.base.BaseBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/4/24 15:01
 * @since JDK 1.8
 * 字典
 */
@TableName("dicti")
@ApiModel("字典模块")
@Data
public class Dicti extends BaseBean {

    @ApiModelProperty("主键id")
    @TableId(type=IdType.ASSIGN_UUID)
    private String id;

    @ApiModelProperty("字典模块名称")
    @TableField("dictiname")
    private String dictiName;

    @ApiModelProperty("字典模块的值")
    @TableField("dictivalue")
    private String dictiValue;

    public JSONArray getDictiValues(){
        return JSON.parseArray(this.getDictiValue());
    }

    @Override
    public Date getCreateTime() {
        return super.getCreateTime();
    }
}
